package cjgl.service;

import java.util.List;

import cjgl.dao.TbClassDAO;
import cjgl.entity.TbClass;

public class TbClassService {
	private TbClassDAO tbClassDAO = new TbClassDAO();

	public TbClass findById(Integer id) {
		return tbClassDAO.findById(id);
	}

	public List<TbClass> findAll() {
		return tbClassDAO.findAll();
	}

	public void delete(Integer id) {
		tbClassDAO.delete(id);
	}
	
	public void save(TbClass tbclass) {
		Integer id = tbclass.getId();
		if(id==null) {
			tbClassDAO.insert(tbclass);
		}else{
			tbClassDAO.update(tbclass);
		}
	}
	
	public void delete(TbClass tbClass) {
		tbClassDAO.delete(tbClass.getId());
	}
}
